package com.ruoyi.api.utils;

import org.apache.commons.codec.binary.Base64;

import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;

public class Base64FileUtil {

    /**
     * base64 视频base64字符串
     * videoFilePath  输出视频文件路径带文件名
     */
    public static void saveBase64ToVideo(String base64, File videoFile) {
        try {
            //base解密
            byte[] videoByte = new sun.misc.BASE64Decoder().decodeBuffer(base64);
            //输入视频文件
            FileOutputStream fos = new FileOutputStream(videoFile);
            fos.write(videoByte, 0, videoByte.length);
            fos.flush();
            fos.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("base64转换为视频异常");
        }
    }

    public static void saveBase64ToVideo(String base64, String videoFilePath) {
        try {
            //base解密
            byte[] videoByte = new sun.misc.BASE64Decoder().decodeBuffer(base64);
            File videoFile = new File(videoFilePath);
            //输入视频文件
            FileOutputStream fos = new FileOutputStream(videoFile);
            fos.write(videoByte, 0, videoByte.length);
            fos.flush();
            fos.close();
        } catch (Exception e) {
            System.out.println("base64转换为视频异常");
        }
    }
    public static Boolean saveBaseImage(File file, String base64ImgCode) {
        base64ImgCode = base64ImgCode.replace("data:image/jpeg;base64,", "");

        try {
            // Base64解码
            byte[] bytes = Base64.decodeBase64(base64ImgCode);
            for (int i = 0; i < bytes.length; ++i) {
                if (bytes[i] < 0) {// 调整异常数据
                    bytes[i] += 256;
                }
            }
            // 生成jpeg图片
            OutputStream out = new FileOutputStream(file);
            out.write(bytes);
            out.flush();
            out.close();
        } catch (Exception e) {
            return false;
        }
        return true;
    }
    public static Boolean saveBaseImage(String filePath, String base64ImgCode) {
        base64ImgCode = base64ImgCode.replace("data:image/jpeg;base64,", "");

        try {
            // Base64解码
            byte[] bytes = Base64.decodeBase64(base64ImgCode);
            for (int i = 0; i < bytes.length; ++i) {
                if (bytes[i] < 0) {// 调整异常数据
                    bytes[i] += 256;
                }
            }
            // 生成jpeg图片
            OutputStream out = new FileOutputStream(new File(filePath));
            out.write(bytes);
            out.flush();
            out.close();
        } catch (Exception e) {
            return false;
        }
        return true;
    }

    public static void main(String[] args) {
        String str = "/9j/4AAQSkZJRgABAQAAAQABAAD/4gIoSUNDX1BST0ZJTEUAAQEAAAIYAAAAAAIQAABtbnRyUkdC\n" +
                "    IFhZWiAAAAAAAAAAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAA\n" +
                "    AADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlk\n" +
                "    ZXNjAAAA8AAAAHRyWFlaAAABZAAAABRnWFlaAAABeAAAABRiWFlaAAABjAAAABRyVFJDAAABoAAA\n" +
                "    AChnVFJDAAABoAAAAChiVFJDAAABoAAAACh3dHB0AAAByAAAABRjcHJ0AAAB3AAAADxtbHVjAAAA\n" +
                "    AAAAAAEAAAAMZW5VUwAAAFgAAAAcAHMAUgBHAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n" +
                "    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFhZWiAA\n" +
                "    AAAAAABvogAAOPUAAAOQWFlaIAAAAAAAAGKZAAC3hQAAGNpYWVogAAAAAAAAJKAAAA+EAAC2z3Bh\n" +
                "    cmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABYWVogAAAAAAAA9tYAAQAAAADT\n" +
                "    LW1sdWMAAAAAAAAAAQAAAAxlblVTAAAAIAAAABwARwBvAG8AZwBsAGUAIABJAG4AYwAuACAAMgAw\n" +
                "    ADEANv/bAEMAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB\n" +
                "    AQEBAQEBAQEBAQEBAQEBAf/bAEMBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB\n" +
                "    AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEICSQEOAMBIgACEQEDEQH/xAAfAAEBAQEB\n" +
                "    AQEBAQEBAQAAAAAACQgHBgUKBAMCAQv/xABmEAABBAICAAQCBQMMDQYICgsAAgMEBQEGBwgJERIT\n" +
                "    FBUaIVio1xYYIhcZIzE4QVd2d5WW1iQyNjc5UVVWl7W2t9VhcXSUtNQKJSY0Qll4gSczQ1NiY5Oz\n" +
                "    0tg1RFJUcnN1g5Ghx//EABoBAQEBAQEBAQAAAAAAAAAAAAACAwEHCgT/xAA3EQEAAAEGDAUDBAMB\n" +
                "I/System.out: AAAAAAAAAQMEBQYHEQIVFyFUV2GUltPV8BIxQVGRcYHxMqGxwSJy0eH/2gAMAwEAAhEDEQA/APyT\n" +
                "    gA+oB7QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n" +
                "    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n" +
                "I/chatty: uid=10365(com.heima.locationsetting3) Timer-0 identical 6 lines\n" +
                "I/System.out: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n" +
                "    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC2n0dDxk/sd/eD6sfjePo6HjJ/Y7+8\n" +
                "    H1Y/G88vy32La3rL+P6qdWfixlR2nzLepDmIlgtp9HQ8ZP7Hf3g+rH43j6Oh4yf2O/vB9WPxvGW+\n" +
                "    xbW9Zfx/VTqxjKjtPmW9SHMRLBbT6Oh4yf2O/vB9WPxvH0dDxk/sd/eD6sfjeMt9i2t6y/j+qnVj\n" +
                "    GVHafMt6kOYiWC2n0dDxk/sd/eD6sfjePo6HjJ/Y7+8H1Y/G8Zb7Ftb1l/H9VOrGMqO0+Zb1IcxE\n" +
                "    sFtPo6HjJ/Y7+8H1Y/G8fR0PGT+x394Pqx+N4y32La3rL+P6qdWMZUdp8y3qQ5iJYLafR0PGT+x3\n" +
                "    94Pqx+N4+joeMn9jv7wfVj8bxlvsW1vWX8f1U6sYyo7T5lvUhzESwW0+joeMn9jv7wfVj8bx9HQ8\n" +
                "    ZP7Hf3g+rH43jLfYtresv4/qp1YxlR2nzLepDmIlgtp9HQ8ZP7Hf3g+rH43j6Oh4yf2O/vB9WPxv\n" +
                "    GW+xbW9Zfx/VTqxjKjtPmW9SHMRLBbT6Oh4yf2O/vB9WPxvH0dDxk/sd/eD6sfjeMt9i2t6y/j+q\n" +
                "    nVjGVHafMt6kOYiWC2n0dDxk/sd/eD6sfjePo6HjJ/Y7+8H1Y/G8Zb7Ftb1l/H9VOrGMqO0+Zb1I\n" +
                "    cxEsFtPo6HjJ/Y7+8H1Y/G8fR0PGT+x394Pqx+N4y32La3rL+P6qdWMZUdp8y3qQ5iJYLafR0PGT\n" +
                "    +x394Pqx+N4+joeMn9jv7wfVj8bxlvsW1vWX8f1U6sYyo7T5lvUhzESwW0+joeMn9jv7wfVj8bx9\n" +
                "    HQ8ZP7Hf3g+rH43jLfYtresv4/qp1YxlR2nzLepDmIlgtp9HQ8ZP7Hf3g+rH43j6Oh4yf2O/vB9W\n" +
                "    PxvGW+xbW9Zfx/VTqxjKjtPmW9SHMRLBbT6Oh4yf2O/vB9WPxvH0dDxk/sd/eD6sfjeMt9i2t6y/\n" +
                "    j+qnVjGVHafMt6kOYiWC2n0dDxk/sd/eD6sfjePo6HjJ/Y7+8H1Y/G8Zb7Ftb1l/H9VOrGMqO0+Z\n" +
                "    b1IcxEsFtPo6HjJ/Y7+8H1Y/G8fR0PGT+x394Pqx+N4y32La3rL+P6qdWMZUdp8y3qQ5iJYLafR0\n" +
                "    PGT+x394Pqx+N4+joeMn9jv7wfVj8bxlvsW1vWX8f1U6sYyo7T5lvUhzESwW0+joeMn9jv7wfVj8\n" +
                "I/System.out: bx9HQ8ZP7Hf3g+rH43jLfYtresv4/qp1YxlR2nzLepDmIlgtp9HQ8ZP7Hf3g+rH43j6Oh4yf2O/v\n" +
                "    B9WPxvGW+xbW9Zfx/VTqxjKjtPmW9SHMRLBbT6Oh4yf2O/vB9WPxvH0dDxk/sd/eD6sfjeMt9i2t\n" +
                "    6y/j+qnVjGVHafMt6kOYiWC2n0dDxk/sd/eD6sfjePo6HjJ/Y7+8H1Y/G8Zb7Ftb1l/H9VOrGMqO\n" +
                "    0+Zb1IcxEsFtPo6HjJ/Y7+8H1Y/G8fR0PGT+x394Pqx+N4y32La3rL+P6qdWMZUdp8y3qQ5iJYLa\n" +
                "    fR0PGT+x394Pqx+N4+joeMn9jv7wfVj8bxlvsW1vWX8f1U6sYyo7T5lvUhzESwW0+joeMn9jv7wf\n" +
                "    Vj8bx9HQ8ZP7Hf3g+rH43jLfYtresv4/qp1YxlR2nzLepDmIlgtp9HQ8ZP7Hf3g+rH43j6Oh4yf2\n" +
                "    O/vB9WPxvGW+xbW9Zfx/VTqxjKjtPmW9SHMRLBbT6Oh4yf2O/vB9WPxvH0dDxk/sd/eD6sfjeMt9\n" +
                "    i2t6y/j+qnVjGVHafMt6kOYiWC2n0dDxk/sd/eD6sfjePo6HjJ/Y7+8H1Y/G8Zb7Ftb1l/H9VOrG\n" +
                "    MqO0+Zb1IcxEsFtPo6HjJ/Y7+8H1Y/G8fR0PGT+x394Pqx+N4y32La3rL+P6qdWMZUdp8y3qQ5iJ\n" +
                "    YLafR0PGT+x394Pqx+N4+joeMn9jv7wfVj8bxlvsW1vWX8f1U6sYyo7T5lvUhzESwW0+joeMn9jv\n" +
                "    7wfVj8bx9HQ8ZP7Hf3g+rH43jLfYtresv4/qp1YxlR2nzLepDmIlgtp9HQ8ZP7Hf3g+rH43j6Oh4\n" +
                "    yf2O/vB9WPxvGW+xbW9Zfx/VTqxjKjtPmW9SHMRLBbT6Oh4yf2O/vB9WPxvH0dDxk/sd/eD6sfje\n" +
                "    Mt9i2t6y/j+qnVjGVHafMt6kOYiWC2n0dDxk/sd/eD6sfjePo6HjJ/Y7+8H1Y/G8Zb7Ftb1l/H9V\n" +
                "    OrGMqO0+Zb1IcxEsFtPo6HjJ/Y7+8H1Y/G8fR0PGT+x394Pqx+N4y32La3rL+P6qdWMZUdp8y3qQ\n" +
                "    5iJYLafR0PGT+x394Pqx+N4+joeMn9jv7wfVj8bxlvsW1vWX8f1U6sYyo7T5lvUhzESwW0+joeMn\n" +
                "    9jv7wfVj8bx9HQ8ZP7Hf3g+rH43jLfYtresv4/qp1YxlR2nzLepDmIlgtp9HQ8ZP7Hf3g+rH43j6\n" +
                "    Oh4yf2O/vB9WPxvGW+xbW9Zfx/VTqxjKjtPmW9SHMRLBbT6Oh4yf2O/vB9WPxvH0dDxk/sd/eD6s\n" +
                "    fjeMt9i2t6y/j+qnVjGVHafMt6kOYiWC2n0dDxk/sd/eD6sfjePo6HjJ/Y7+8H1Y/G8Zb7Ftb1l/\n" +
                "    H9VOrGMqO0+Zb1IcxEsFtPo6HjJ/Y7+8H1Y/G8fR0PGT+x394Pqx+N4y32La3rL+P6qdWMZUdp8y\n" +
                "    3qQ5iJYLafR0PGT+x394Pqx+N4+joeMn9jv7wfVj8bxlvsW1vWX8f1U6sYyo7T5lvUhzESwW0+jo\n" +
                "    eMn9jv7wfVj8bx9HQ8ZP7Hf3g+rH43jLfYtresv4/qp1YxlR2nzLepDmIlgtp9HQ8ZP7Hf3g+rH4\n" +
                "    3j6Oh4yf2O/vB9WPxvGW+xbW9Zfx/VTqxjKjtPmW9SHMRLBbT6Oh4yf2O/vB9WPxvH0dDxk/sd/e\n" +
                "    D6sfjeMt9i2t6y/j+qnVjGVHafMt6kOYiWC2n0dDxk/sd/eD6sfjePo6HjJ/Y7+8H1Y/G8Zb7Ftb\n" +
                "    1l/H9VOrGMqO0+Zb1IcxEsFtPo6HjJ/Y7+8H1Y/G8fR0PGT+x394Pqx+N4y32La3rL+P6qdWMZUd\n" +
                "    p8y3qQ5iJYLafR0PGT+x394Pqx+N4+joeMn9jv7wfVj8bxlvsW1vWX8f1U6sYyo7T5lvUhzESwW0\n" +
                "    +joeMn9jv7wfVj8bx9HQ8ZP7Hf3g+rH43jLfYtresv4/qp1YxlR2nzLepDmIlgtp9HQ8ZP7Hf3g+\n" +
                "I/System.out: rH43j6Oh4yf2O/vB9WPxvGW+xbW9Zfx/VTqxjKjtPmW9SHMRLBbT6Oh4yf2O/vB9WPxvH0dDxk/s\n" +
                "    d/eD6sfjeMt9i2t6y/j+qnVjGVHafMt6kOYiWC2n0dDxk/sd/eD6sfjePo6HjJ/Y7+8H1Y/G8Zb7\n" +
                "    Ftb1l/H9VOrGMqO0+Zb1IcxEsFtPo6HjJ/Y7+8H1Y/G8fR0PGT+x394Pqx+N4y32La3rL+P6qdWM\n" +
                "    ZUdp8y3qQ5iJYLafR0PGT+x394Pqx+N4+joeMn9jv7wfVj8bxlvsW1vWX8f1U6sYyo7T5lvUhzES\n" +
                "    wW0+joeMn9jv7wfVj8bx9HQ8ZP7Hf3g+rH43jLfYtresv4/qp1YxlR2nzLepDmIlgtp9HQ8ZP7Hf\n" +
                "    3g+rH43j6Oh4yf2O/vB9WPxvGW+xbW9Zfx/VTqxjKjtPmW9SHMRLBbT6Oh4yf2O/vB9WPxvH0dDx\n" +
                "    k/sd/eD6sfjeMt9i2t6y/j+qnVjGVHafMt6kOYiWC2n0dDxk/sd/eD6sfjePo6HjJ/Y7+8H1Y/G8\n" +
                "    Zb7Ftb1l/H9VOrGMqO0+Zb1IcxEsFtPo6HjJ/Y7+8H1Y/G8fR0PGT+x394Pqx+N4y32La3rL+P6q\n" +
                "    dWMZUdp8y3qQ5iJYLafR0PGT+x394Pqx+N4+joeMn9jv7wfVj8bxlvsW1vWX8f1U6sYyo7T5lvUh\n" +
                "    zESwW0+joeMn9jv7wfVj8bx9HQ8ZP7Hf3g+rH43jLfYtresv4/qp1YxlR2nzLepDmIlgtp9HQ8ZP\n" +
                "    7Hf3g+rH43j6Oh4yf2O/vB9WPxvGW+xbW9Zfx/VTqxjKjtPmW9SHMRLBbT6Oh4yf2O/vB9WPxvH0\n" +
                "    dDxk/sd/eD6sfjeMt9i2t6y/j+qnVjGVHafMt6kOYiWC2n0dDxk/sd/eD6sfjePo6HjJ/Y7+8H1Y\n" +
                "    /G8Zb7Ftb1l/H9VOrGMqO0+Zb1IcxEsFtPo6HjJ/Y7+8H1Y/G8fR0PGT+x394Pqx+N4y32La3rL+\n" +
                "    P6qdWMZUdp8y3qQ5iJYLafR0PGT+x394Pqx+N4+joeMn9jv7wfVj8bxlvsW1vWX8f1U6sYyo7T5l\n" +
                "    vUhzESwW0+joeMn9jv7wfVj8bx9HQ8ZP7Hf3g+rH43jLfYtresv4/qp1YxlR2nzLepDmIlgtp9HQ\n" +
                "    8ZP7Hf3g+rH43gZb7Ftb1l/H9VOrGMqO0+Zb1Icx/wDUcBFHkbfN5i+NBwhokXc9rjaRYccTJc/T\n" +
                "    Y+xXDOqzpSeL+V5aZMzXm5iaiTITKhQ5OHnoa3MSIkZ7CvcYaUi1x857yQAAAGHO8vc9HS7T9D2x\n" +
                "    fHCuSMbvtz2q4gJ27GoZrMtVb9l8dmVnWdn+Mwr2fZ+G+Hi+Xq9z38+XozuMAAAAMwdvezuqdTOF\n" +
                "    Nj5S2H4adcJTmm0TWHX/AGXts3Oaw+qqqk+hWHkwGMMu2V3KZxlcOmhTXmsLk/Dsu408NHvhzJ3H\n" +
                "    2DmKn5X1fjnW8cd12oyaxGjUm1U8pyVezdji2DNunZNw2j14j/J4+GG47UFxpxUjD6nvNCWgrUDk\n" +
                "    XO3Nujdd+K9r5c5EmPRta1SEh5yPDQ29Z29jLebh1NHUR3HGUSLS2nvMQ4qHHWmGsuLlTH48KPJk\n" +
                "    NR9oe43iodg6l7lDrx1f0Ko4lkrde1hO1SYDl3fwGn1tZfYnbPvulrv2/JC8/G0OvQK91TTrESRL\n" +
                "    kJwlYXfBNfoz30seymwbtwzy/oWOKOw3GrT8jY9VbROjVlxAgTWKu2m1kC2dftaebT2UqIxZU02X\n" +
                "    Y5THnQZ8GzmsOym4NKAAPhbTs1FpWtbBuG0WUam1rVaWz2G/tpisoi1tNTQnrCynSFYxnOGosOO8\n" +
                "    8vCcKVnCM4QlSs4xmJtP3u779rbnYrfpR1809jiHXbWVUMbnyY/GRYXUuMlt1KFSbPb9YpmZT0d1\n" +
                "    h9+kpol4/UYlMYsLlPut5yFzwR+67+IdzDD56qOrPdriOs4j5S2jMVjTNk15TrWuXk6wU+3TwZMZ\n" +
                "    y52SDIavZEd2tqdh17Y7CrlXqPk7kGG/lxbFgc5xjGc5zjGMY885z9WMYx+3nOf3sYAAkBzh4qke\n" +
                "I/System.out: LyRL4S6icQ3fZbkeDIfh2VrUJsntPgyor2Y0zFc1RxJlpscSuk5bZsrjD1FrsbC8PR7uaz6lo710\n" +
                "    65B79b3te2SO23D+k8X6QnXWJOmZ1hyqTPlX7tmxh2HPiN8h7ldMNMVWXl4zPhV6Mu48lPKe8mgK\n" +
                "    Cg4h2J5+0LrNxPsnLnIkl9FLRNtMQayDhtdvsl9Nypuo12mZdW225YWT6VYwt1bcaFEalWM11mFD\n" +
                "    kvNyNoe4fiu8y0X6sXDHVjj6NxFMQqy1qsvstyL++pELXlMmLi35C1LYNiS+2jLkWwodar4lk2tt\n" +
                "    dSzMwpOVheEGCujvebXO3tHstPaa3I455l48exF3/juc5IUqOj4hcH5zTrmMRZyq/Fgy9XWddPjt\n" +
                "    2mvWiUwLDDrcivnz/v8AdbutpfTnSamwn1EjdeR91kyK7jzjyvk/CyruVGywiXZWMpDEt6BR17su\n" +
                "    Gy88xDlzZ06XFr4EZa3ZEmGG1gQite0njCa5rzvLt51W46Tx3GYcu5+rx4GXtng662j4pxyRQw+T\n" +
                "    5m9xZTUL15fW9QuyYa2XJE2mYZTllVHemHcXRO5XGTu6azCd1vaNelsVG+6PMlomy9btpDKn4j0a\n" +
                "    almNizobdlt56ntMRYynsxpsORHYmwJTKA2ADFHd3ulqfTbQai5m0r258g7vOl1HHehxZXwbt1Nh\n" +
                "    IjKsLKwkoZkvxqSoVOr25a4sWTMlTbGur4rSVSnJUXBsjsJ4y0CgzyfK6xcUuamhnNy/pDEVDu1s\n" +
                "    USUZkqxnX2OU3Nx+P+F/Q+BREkXTcjGMu0WPSuMBckGMeknczUO5vGk7a6iod1PctTnxqXf9KkTE\n" +
                "    z1UljLYcfr59fO9mMudRXLceZmukvxYslEiDYwX2cuQsvv8A83d3ulqfTbQai5m0r258g7vOl1HH\n" +
                "    ehxZXwbt1NhIjKsLKwkoZkvxqSoVOr25a4sWTMlTbGur4rSVSnJUUNrghtI7CeMtAoM8nyusXFLm\n" +
                "    poZzcv6QxFQ7tbFElGZKsZ19jlNzcfj/AIX9D4FESRdNyMYy7RY9K4xvvpJ3M1DubxpO2uoqHdT3\n" +
                "    LU58al3/AEqRMTPVSWMthx+vn1872Yy51Fctx5ma6S/FiyUSINjBfZy5Cy++GzgTe7s9+V9b9k1L\n" +
                "    hfiXQnuYOxPILUd7XtMY+MdrqWJPkPRKuZdR6rHzSzmWkmPJxX0MB6C6uHFlWU+0rIqYeZ+ONs7j\n" +
                "    eKx19rGuU+fOsvHM/iaKqJI2dvW3YXx1JBmSEspw7P1rkPcJ+urQ4tlvNjfUNpWMuSGo8leJK/Jo\n" +
                "    L0A5JwVzRpvYTijTeX9Cffc1vcq1UxiPMS2iwqp0WS/X29JZttOOtN2NPaxJldLw044w47Hy/Gde\n" +
                "    jOsvLwb287/7pxxy9VdXOrfGUbmXsRaRo8myiWCpDuu6jidX4tokSfEhT6l2bY/JVtXlg7Mu6Kno\n" +
                "    6qRCmz58jD70eOFTQQk2/uf4m3V1iDyB2f648dXvECpkCNsNno02Iixo82EluO02u3od12yLUO+6\n" +
                "    6iLHevqB2qnznYkBi2bkSEqVZXiPlPUObeNdO5W0Oaufqe70zFxUvPIS1KYwpbkabXT2UrcTHs6m\n" +
                "    xjy6uzjpccTHnw5LKXHEowtQdGAIo8jb5vMXxoOENEi7ntcbSLDjiZLn6bH2K4Z1WdKTxfyvLTJm\n" +
                "    a83MTUSZCZUKHJw89DW5iREjPYV7jDSkBa4AAAAAAAAAAAQP538Zraqh3eIfAXXe2t63QLiXRbJy\n" +
                "    NyOiylaxTz49wmjZ+Y0umPJYixbCxWzHr3rDeqx+U9LiMJhpfeS3mvnWXk6+5n6/cRcrbREqIGxb\n" +
                "    /o1Js1xCoI82LSxp9lHw8+zWR7GfazmYiFZ8mm5VjMeSn6lyHM/WB3QEiOd/EB5m2Lm+/wCs3Rji\n" +
                "    Sr5e5E0xciPv26bG7nOnazNhSW4lpXsYxc65XozUTF5rZ1zd7DEiYuW3qqDV2jzXuL5vO7394eqm\n" +
                "    xa1I7zcB6mniLZ7aNTK5H4sdRIkUMuQ244pT+K/aNnrJzzDLLshFFPja3Y2EeNOeq50/Mb4dQW/B\n" +
                "I/System.out: 82muKvYaeqv6SdHs6a8rYNxUWUReHYthV2cVqbAnRnMfU5HlxH2n2V4+pbbiVY/bIn8j99u8992i\n" +
                "    5x4K6q8J8R8oU/ENo1Cfduq2/wAX7EZiPXQbKRa2LnLOoUz68bI7YRI7UGAw6iO02hxl1bL8lYXC\n" +
                "    BHnjLsB4t1zyTx7T8k9UOItc47tt41Ot33YaxmVixodLn30CLtNzX5VzxcJxNq6N2dOi5VUWicPs\n" +
                "    N5zXTcecZ2wwAH+EqTGhRpEyY+zFiRGHZMqVIcQzHjRmG1OvvvvOZS20yy0hTjri1JQhCVKVnCcZ\n" +
                "    yRFt/EQ7Y9k9/wBq1Lw/eCaPb9J0ucqvteUN+9LUK0cwp1LMuEqz2XUKCjjz8NOSKysnTbrYJ9dh\n" +
                "    ue7XVinHYjAXBBGPg7xDewOm88ar1v73cO1HF208gPw4Wj7prmPh6aVY2kr4Cni2WGtg2mitYNra\n" +
                "    edO3e65e+zW2bkWJZVqW3JU+JT/nbm3Ruu/Fe18uciTHo2tapCQ85Hhobes7exlvNw6mjqI7jjKJ\n" +
                "    FpbT3mIcVDjrTDWXFypj8eFHkyGg66CEFD3G8VDsHUvcodeOr+hVHEslbr2sJ2qTAcu7+A0+trL7\n" +
                "    E7Z990td+35IXn42h16BXuqadYiSJchOEr1v0Z76WPZTYN24Z5f0LHFHYbjVp+RseqtonRqy4gQJ\n" +
                "    rFXbTayBbOv2tPNp7KVEYsqabLscpjzoM+DZzWHZTcEKUAkxzlzt4qGtctbzRcJ9XuKtz4rrLnMf\n" +
                "    StovGZOba6qMRIy/i5uU83a2nLvxa5LWMpo67GUNozhj/wCUXxK/7YeMVq1Fc7NsPUfgyooNdqrC\n" +
                "    8u7WYiW3EramqiPT7GfKcx2IzlEeJDYekPKxjOcNtqzjGc+WMhdQE9vDh7T8u9uuHtq5L5Y1bT9a\n" +
                "    dr9+matrS9KqdgqKm2rK+kpZsyWpvYtl2eTKfj2djIhOSospiH6mFRsM5kxpKj/juL4inF3VKxha\n" +
                "    BApLTljm26bi5quMtXfwy5BzZY9NS5s1qiLYuVirRxTWK2pgVltez0OsPIrmYUliaoKGAkNwj2C8\n" +
                "    ULlflLQZu29XtP4v4Itr6tztsy1bRWblU6s7jLkuSqJtXIUG+cnYRlGMNxtGTITjPpTX+4lSsba7\n" +
                "    bdqtD6h8TzOTN1Yk3EuTNbo9Q1Gvfaj2e17JIYfkMV7Mh5DrcCBGjR35tvausvtwITKstR5k56FA\n" +
                "    lhp8EI4naPxg9119rlnSeq/HULjycwi4pdbsIjbmzTqBxnMuPIVTWfJtNulmuTGwj2V19DWybH32\n" +
                "    nqyqU04nKd6dFu7ND3H0jYZMjXV6Lydx9PiVPIekOvuSGoT07EtNdcVLsltiYqrsXa+xjLiTmUT6\n" +
                "    mxgS4EvMhtMSfODdAJvd2e/K+t+yalwvxLoT3MHYnkFqO9r2mMfGO11LEnyHolXMuo9Vj5pZzLST\n" +
                "    Hk4r6GA9BdXDiyrKfaVkVMPM/HG2dxvFY6+1jXKfPnWXjmfxNFVEkbO3rbsL46kgzJCWU4dn61yH\n" +
                "    uE/XVocWy3mxvqG0rGXJDUeSvElfk0F6AZUidgrnmHqlJ586v0UPdNtv9Nl22g6hsqE4be2yFLXX\n" +
                "    TdW2FmPeUiUSau0jT6+dhm/gsLci+/GnqiutOuTs/OS8aL7G/Cv/ANjL/wDzEgW+B+djmDxGvE84\n" +
                "    EzqqOW+uHA+oP7vYyKnUob1Rs1vYX9hE+ExIjV9dQc7Ws51TS7CC0peY6WvemRWMLy8+0hVyOUeY\n" +
                "    9Z4O4cvuYeVH/k9PqOtxLbYGIaErkO2srEWJHoqlh2RlL9jaXkyNTVUdyX6HJcphL0pLXrfSHXwQ\n" +
                "    q1buD4ovZSulcmdbut/G1FxE8/Mxqju6zoObjY2IUh6M57VlsO86k3bKy6ytlU2qoq2nbktPRE2U\n" +
                "    h5h1Zovpr4ge1cv8qbB1m7IcaM8O9idcjS5DVZC+MYotnxWQ27Cxiwq+yl2M2ss2apfz2E23b3lZ\n" +
                "    dUKH7WvsksMobeCpQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n" +
                "I/System.out: AAAAAAAAAAAAAAAAACE3J3+HL4E/kwm/7qOYCt/YjbuVtE4d3TbOEtHg8kcm08SC5rOmWCp2I9y9\n" +
                "    JtoEKZ+x1zjEqS5Ar5MqzRDblQsTPgsxlToeHfiG5Icnf4cvgT+TCb/uo5gKmdq+yun9UOGr7l7c\n" +
                "    Ikm2bhSYdLruuQXm403Z9ptcP5q6WPKeS41EbU1FmWFhNU0+qFVV8+W1FmPMtxHwl1ljxyt1QjZW\n" +
                "    LTini5vOFSW9JxF4qeW4jzypEZarCq36UzlxPkhLcraI7zeFYxIcZeSrKe8dG+8PLHK3IvIvV/sz\n" +
                "    pkDSOxfHNZLtGl10ZMGv2KFCzCRMZmQW5lhXR7aK3bVNrDm0856l2Kjmqsa5iKxDy5N5do2/+L92\n" +
                "    GpK/kzTKvr/wZpOxsM3Op0G6RJjtrZa/NaTJrJkhC67dLdKZkVTbiH58fW3ZaXUy2K2LDeZzjOXB\n" +
                "    6+fo/jBae12OY0KPyjI40vI11I42xKTrV1TxuML35JY5xNcVI+Nfjwo3xSVswsIVFZSiFHQhKchn\n" +
                "    vxIl9/1aFxn+du1xcjWcb2/nT86LmtzMzsvyaT7mJ/wTi1/B/L/e8vcxhHu+n6/Mtv1TX4iSuRbf\n" +
                "    HbVrihvjf8jbHNPnRs1ebfO6fOdf+W4kfBOLd+XfJPyiy96sYb+JxE88+r04zjrxz/7z3A38r0v/\n" +
                "    AGXnFygMD6Btfd2X3H3rXN402shdTIjN+rStqai6uixmvtQ6xVIh5+LeP7ApDstyyRnMmmj+rDLf\n" +
                "    vLSn0qd3Ta2tbR1djdXM6LV1FRBl2lpZTn240KvroEdyVNnTJLqktR4sWM06++84pKGmm1rWrCU5\n" +
                "    yf3kG/GP7SWdE7pXUWlt3dHrOSoFNtXKu/S41o7DiaJN2CbUQKqPHpYs24sK5U6ltLXamKuG/MlQ\n" +
                "    quFSxWJqLKxiAeC1CruPFk7iy+QdgjTm+nPXexzXa7TzWXo8XdZ2Hm5TUB9leEYVY7q9GjXe1J9P\n" +
                "    v1GmRqbX38R50+NOd6F4U7bbPbbxEmmm0NNNckuttNNpShtttHJfKaUNtoTjCUIQnGEpSnGEpTjG\n" +
                "    MYxjGMHWuvnfTwz+t/Euo8RaFzNJbptZgpTLsXuKuWW7HY72ThLt1stuprQsJcsrib65DuMZy1FZ\n" +
                "    +Hr4mG4UOMy3hDw9O4HXriLsv3C2zkDe3aKh5q5DRM41mo1TcrVWwx5u/wC92UZa4tPQT5dPlyHf\n" +
                "    1LvovGK1aMystuJS6xIQ0H6J+WuGuMeddRc0TlrT63dtTdmsWXyizXMZbasYzMmPGsIsmvlQ5sOb\n" +
                "    HZmSm2JUWSy+0l9z23E5VnJyLkLtL1S6vQWdC3flDTdAc0nWqliv0RpyVO2CDr0WubZo4tdrdVGn\n" +
                "    28hlcCO0zBSzFc9xKMYyv9FasaqMd839B+qnYrbZm+8scZu7Bus6ug1buyRd03yjlJhVjGY8BpEG\n" +
                "    k2aBSecZrOUpU5VuZcz+k/7qvrAnZ0W17bexvfLnPvdC0+90jhi6ppOs6G/fwVVsvdJK6fVdXiTY\n" +
                "    UfP7HKi4p9ZeuryXFclQot3ZRKxiZNkMznI11yAnHkjcvD98Q3jrqtqvIG2bv145xoKqypdL26zz\n" +
                "    cSNGc2KZtNLUKqXfShuE/U7FqzjTz8KJBjWmtT8N2keXaQGLNm/YHAe1HGt/zD1x5p4x1R1lrZt0\n" +
                "    482OloMSHsRo0i3ehLdr4EmSrGUxo1jKabgSJC8ZQwzJW6tKkozjMt/DX7b8JcF8DtdbefNjicFc\n" +
                "    scS7PuEW9o+SI8jV82rF9sVjskawjzprKIS5MdNrmqdhSJDU5TMCLMjMv18qNIVv3v1z9sPWvq1y\n" +
                "    Nydp7bWdwZRT63qsmQ0h+PWXO0W0WnbunWHUOMvqposiXaRY8htyNJnRYsaShUd1zGcNdIfDw4Q5\n" +
                "    N4X1PsB2RrLPnXljmqpb3m1ud12XY5casr7z9lqYTDEW1iKsJ/ytEN6fZ3C58pqW69ErlQ4TDbaw\n" +
                "I/System.out: 5Pzlf0viCd8utMbrdiXtmk9eLSq2Xk/mGFWTY2pwGIm31O0KqodtMYi4myUNUHwVDhrzTaW1zKdr\n" +
                "    kSK2usbBrYni2dhLngvqvOqNUmv122cxXjfHMKyiPKYmVOvyK+bZ7bYxXm3G3WnnqqGmgQ81n3o6\n" +
                "    75MpnKHWEOJn/wBz+J4/hgcscP8AYrqpaXWpafuewTKLe+KJF/a2euXHyhLFm5WKxayJ0uZS3lTI\n" +
                "    s4/tWcibJ1qzjxrKjlRnXmEQugeOyzMteM+tOzREvppPym3Vl/C0+lKZl9r+t2FSl9Pnn0v/AAlV\n" +
                "    a+lP1+WMPY8/q+sPk9cO4vUvozxhV8U8caJvvN/KDVPX3fOe88X63Xz6bO3vxsP2FTI22xnQnrCm\n" +
                "    1iQ9JpabNXCk0CWIUiW3NXYy7Bx6oXU3vtwN3BRZ13Hs251/dqSJmwttA3KLCr9jRWYeRGXcViq+\n" +
                "    fZ1l1UokOstPyK+c5JgKkRMWkKvVMipe7twPxhxjxHxXpuocRUNZR6XHoauVXLr2msv3WJkJiR8+\n" +
                "    trBCcP3FtbYcxMm2ktx1+U67lXrw36EJiz3B1Kk4E8UfpzyNxVBja9d8wbNq1VvVPSsohRLRV5uj\n" +
                "    OhbDcvRIiWm8Sdi1rYno89Sk+xJm1HzOQhcx2Y+6H1fF0lyeTexHSfrM/IkI1vdN1qp19DYWpv4t\n" +
                "    7dN3otCr5SnEKw4h6srkbEiM6jKMtJs5K/VnPllF5a6vg1FfBqquIxArayHFr66DFbSzFhQYTCI0\n" +
                "    SJGZRjCGmI0dptlltGMJQ2hKU4xjGMEGfE8RnSu9/QLlawziPRNbVqFfMnOpymO0zp3LVDc2+HHs\n" +
                "    /saMt1u1Jd+vPqQnzczjKcF8gPz/API7LXAPjW8ZWmsJxWVvPur07u2V8dKURrF3dYGzabLytvHl\n" +
                "    hOZW1aZT7LJUnOFPWzTklfrU64lf9vadyvX4yXVNrkfLWNMZ1HVM6wm2yn5T86VI5JXrjkfD/wDY\n" +
                "    3xquRMVKEKx+zKltV6VZ/Qj4T/n2YaxyJ40PWDXqj+y5GhadpD12hnCnfgFa5L5J5OezKwjGfYz8\n" +
                "    psa93CnM4x5So3nn9lQnNHO63SLR+5Go00SxuJWj8j6U9JmaDyHWRMTJVQ7Kyy5JrLSEmTCcsqSY\n" +
                "    /GiyctMzoU2BNjsza+W1nMuPNDbWfLyz5+Xl5Z8/P9ry/f8APz+ry/xn5yfDwvdf1XxRO0+j8aWc\n" +
                "    SXxhtMflR2uj1K23KRS6PfKe0qXK5bCcMuQ6TE69p6p5lSoy4EtamVvIcacVpSN0t7+WGuTNP5t8\n" +
                "    QJVbwxX1j7ewzNWrnM7hN1SDGyuxas9vtKvX7WCh6uafTYT7PY75lDHurnM2LKnml5T8HTjGht+1\n" +
                "    fYnlzQIVhH4i0iovdH0J6xVIfkyYu3bdGma1mVOkpTmVasahqrki6ShDXtyriO77ERh+PHyGlfFp\n" +
                "    473iq3/q32op9Wst30Dgbb4ljyNTVMfMyZV1tbt2tbZHsX4mE5SmotGKewqrGyfU3CrZCKxM5xDM\n" +
                "    zDjez3/Es6Ss6Pne8c8as9E+WfMUa2yiwXvC3Ms+4mrxp+YibtuzU7nEX23ozUVD3m45LREwqTjC\n" +
                "    /iG7/wAg87du+EOgGs7dbaBx7vESouuTrWkkLi2WxxbXN9OnVTyk+SZVbV6vr8l+DWSFOVlle2Ta\n" +
                "    7aJJbrIfo13I8KPoy/pv5Ho4fXGdxEywjbmNu27G5Il5RnHzX5q7cuxXZfuZy98I/XO0mFeTWKnE\n" +
                "    XCY+Azn4RnEe9V0zsd2Q2bV7DRNW7BbfGteO9WtYyoU93XY95t1/86VDXhC26lWNnjVtDIy02iwZ\n" +
                "    hzp0TDla/Akyfk+LTx3vFVv/AFb7UU+rWW76BwNt8Sx5GpqmPmZMq62t27Wtsj2L8TCcpTUWjFPY\n" +
                "    VVjZPqbhVshFYmc4hmZhxv4Hhp8gck8P9p+fehu27bZb5o/G0TYLjj21tX3JUqhj65d0VezAiZdU\n" +
                "I/System.out: tcGsvaHY4E6TTtvKrqa4rnW6xlvFhNde/wBvEN3/AJB527d8IdANZ2620Dj3eIlRdcnWtJIXFstj";
        System.out.println(str);
        str = str.replace("\n","").replace(" ","").replace("I/System.out:","");
        saveBaseImage("d:/sunyishi.png", str);
    }
}

